<div class="page">
	<div class="pageContent" layoutH="0">
		<div class="panelBar">
			<ul class="toolBar">
				<li>
					<a class="add"
						url="category/rule_add.html?category_id={category_id}"
						target="dialog" width="550" height="340" callback="reload"><span>添加</span>
					</a>
				</li>
				<li>
					<a class="add" url="/category/rule/{rule_id}" target="navTabTodo"
						area="tbody.list" callback="navTab.reload()" type="post"
						warn="请选择需要执行的规则项！"><span>执行规则</span> </a>
				</li>
				<li>
					<a class="delete" url="/category/{category_id}/rule/{rule_id}"
						area="tbody.list" callback="reload" type="delete"
						target="navTabTodo" title="确定要删除选中的数据吗？" warn="请选择需要删除的数据项！"><span>删除</span>
					</a>
				</li>
			</ul>
		</div>

		<table class="list" width="98%" layoutH="54">
			<thead>
				<tr>
					<th width="25">
						<input type="checkbox" name="objectId" value="rule_id" />
					</th>
					<th>
						抓取地址
					</th>
					<th width="25%">
						标题抓取规则
					</th>
					<th width="25%">
						内容抓取规则
					</th>
					<th width="60">
						编码方式
					</th>
				</tr>
			</thead>
			<tbody style="display: none;" class="templet">
				<tr rule="${rule_id}" put="/category/{category_id}/rule/${rule_id}">
					<td>
						<input type="checkbox" name="rule_id" value="${rule_id}" />
					</td>
					<td name="url" title="${url}" class="edit" field="url">
						${url}
					</td>
					<td name="title_rule" title="${title_rule}" class="edit"
						field="title_rule">
						${title_rule}
					</td>
					<td name="content_rule" title="${content_rule}" class="edit"
						field="content_rule">
						${content_rule}
					</td>
					<td name="encoding" title="${encoding}" class="edit"
						field="encoding">
						${encoding}
					</td>
				</tr>
				<!-- 
				<tr parentLayout="${layout_id}" class="hide">
					<td colspan="7" align="right" id="layout${layout_id}">

					</td>
				</tr>
				 -->
			</tbody>
			<tbody class="list" action="category/{category_id}/rule">

			</tbody>
		</table>
	</div>
</div>
<script>
function updateRule(item){
	var table=$("table.list");
	var rule=$("tr[rule="+item.rule_id+"]",table);
	rule.find("td[name=url]").text(item.url);
	rule.find("td[name=title_rule]").text(item.title_rule);
	rule.find("td[name=content_rule]").text(item.content_rule);
	rule.find("td[name=encoding]").text(item.encoding);
	alertMsg.correct("更新成功");
}
</script>
